package models

import "time"

type SysCourse struct {
	ID int `json:"id" gorm:"primary key"`	// 课程号
	CourseName string `json:"course_name" orm:"index;not null"`		// 课程名称
	Credit float64 `json:"credit"`					// 学分
	ClassHours int `json:"class_hours"`     		// 学时
	CourseType string `json:"course_type"`	// 课程类型
	Teacher string `json:"teacher"`		// 授课教师
	DepartmentID int `json:"department_id"`
	SemesterID int `json:"semester_id" gorm:"index;not null"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
	Department SysDepartment `gorm:"ForeignKey:DepartmentID;AssociationForeignKey:ID" json:"department"`
	Semester SysSemester `gorm:"ForeignKey:SemesterID;AssociationForeignKey:ID" json:"semester"`
}
